package com.taobao.txc.common.util.a;

import com.taobao.txc.common.b.c;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.sql.Blob;
import javax.sql.rowset.serial.SerialBlob;

public class a
{
  public static Blob a(String paramString)
  {
    if (paramString == null) {
      return null;
    }
    try
    {
      return new SerialBlob(paramString.getBytes());
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      throw ((c)localException);
    }
  }
  
  public static String a(Blob paramBlob)
  {
    if (paramBlob == null) {
      return null;
    }
    try
    {
      return new String(paramBlob.getBytes(1L, (int)paramBlob.length()));
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      throw ((c)localException);
    }
  }
  
  public static String a(InputStream paramInputStream)
  {
    try
    {
      ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
      int i = -1;
      while ((i = paramInputStream.read()) != -1) {
        localByteArrayOutputStream.write(i);
      }
      return localByteArrayOutputStream.toString();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      throw ((c)localException);
    }
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.common.util.a.a
 * JD-Core Version:    0.7.0.1
 */